.TH matwm2 1 "Januari 18, 2009" "matwm2 Manual" "matland Utilities"
.SH NAME
matwm2 \- Window manager for X11
.SH SYNOPSIS
.B matwm2 [ \-display
.I display
.B ]
.PP
.B matwm2 \-defaults
.PP
.B matwm2 \-version
.SH DESCRIPTION
.B matwm2
is a simple window manager for X11. It features window frames with titlebar and buttons, configurable key bindings and mouse buttons, support for EWMH and motif hints, focus-follows-mouse and click-to-focus focus models, virtual desktops, Xft fonts and xinerama support.
.PP
To exit matwm2 send it SIGINT signal. At exit matwm2 will place the windows back on the root window in stacking order, iconic windows on the bottom, above that the windows from all inactive desktops in reverse order and then above those the windows from the current desktop and sticky windows shown on it. If matwm2 receives a SIGUSR1 signal it will reload all configuration files.
.PP
When a focussed window dissapears the window that was focussed before will be focused (unless the "click_focus" option is set to "false" and the cursor is above another window due to the window dissapearing), and if no previous window is there (if it has dissapeared for example) then the topmost window will be focused.
.PP
Further, explanition of the various options in the configuration file(s) below combined with the default configuration, schould give you an idea of how to use matwm2. Just keep in mind there is no default built-in way of launching applications exept the ctrl-mod1-return key binding, wich spawns an xterm.
.SH OPTIONS
.IP -display display
Specify the X display to use.
.IP -version
Show wich version of matwm this is and exit. As of version 0.0.97 this will also print some information on the options matwm was compiled with.
.IP -defaults
Print built-in default configuration to stdout and exit.
.SH FILES
.IP /etc/matwmrc
System wide configuration file.
.IP $HOME/.matwmrc
Per user configuration file.
.PP
Both of these config files share the same format, and can be considered a list of "commands" that may or may not have arguments, separated by spaces. The commands themselves are separated by newlines. If matwm2 encounters a '#' character in one of these files, the rest of the line is ignored. To use a literal '#' or '"' you can precede it with the escape character '\\', and for a literal '\\', "\\\\" will do. For arguments of type [string] double quotes (as in the character '"') can be used to omit whitespace being stripped.
.PP
Any value set last overrides previous values for the setting, matwm2 reads the default configuration first, after that it reads the global configuration file and last the the user's personal configuration file (if these exist).
.PP
Following is a list of possible commands for matwm2 configuration files and their explanation. Valid modifier keys are "shift", "lock", "control" and "mod1" to "mod5" (see: output of xmodmap).
.IP "background [X11 color name]"
Sets the background color of window frames when they are focussed.
.IP "inactive_background [X11 color name]"
Sets the background color of window frames when they are not focussed.
.IP "foreground [X11 color name]"
Sets the foreground (text, border) color of window frames when they are focussed.
.IP "inactive_foreground [X11 color name]"
Sets the foreground (text, border) color of window frames when they are not focussed.
.IP "border_color [X11 color name]"
Sets the color for borders around focussed windows.
.IP "inactive_border_color [X11 color name]"
Sets the color for the borders of not focussed windows.
.IP "font [font name]"
Sets the font used for drawing text. Will take both X11 font names and - if compiled with Xft support (run "matwm2 -version" to find out) - fontconfig patterns.
.IP "no_title [string]"
Set the title for window's that don't have a title to [string], or if used without an argument use an empty title.
.IP "doubleclick_time [integer]"
With this option you can specify how much time there can be between two clicks at most while still considering it a double click, in miliseconds. 
.IP "border_width [integer]"
Sets the width of window frame borders to [integer] pixels.
.IP "border_spacing [integer]"
Sets the space between the window border and the actual client window to [interger] pixels.
.IP "title_spacing [integer]"
Sets how much space there is to be between the bottom of the title text and the actual client window.
.IP "button_spacing [integer]"
Sets the amount of space that goes between buttons (and the left buttons and title if center_title is false) to [integer] pixels.
.IP "wlist_margin [integer]"
Sets how much space goes around text in window list items to [integer] pixels.
.IP "wlist_maxwidth [integer]"
Sets the maximum with for items in the window list to [integer] pixels, if set to 0 or bigger then the display's width the window list will be restricted to the width of the display.
.IP "snap [integer]"
Snap windows together or to screen edges when they are [integer] pixels away from eachother, set to 0 to disable snapping.
.IP "desktops [integer]"
Sets the amount of virtual desktops.
.IP "exec [command]"
Invoke "sh -c [command]" when matwm2 starts. Doesn't override previous occurences of this command.
.IP "exec_onload [command]"
Invoke "sh -c [command]" whenever the configuration file it is in is read. This also can't be overriden.
.IP "ignore_modifier [modifier key] [...]
Ignore the state of specified modifier key(s). Set to "none" to disable.
.IP "mouse_modifier [modifier key] [...]"
If specified modifier key(s) are down, user can use the same button actions as set for the window frame in the client window itself.
.IP "no_snap_modifier [modifier key] [...]"
If specified modifier key(s) are down while dragging a window (either to move or resize it) windows will not snap to eachother or window edges.
.IP "click_focus [boolean]"
Sets the focus model, if set to "true" matwm2 will focus windows when they are clicked. If set to "false" windows will be focussed when the mouse cursor moves over them. If it is false and the window under the mouse somehow hasn't got focus anymore, and windows that have EWMH hints set to specify they are a desktop will always be focussed only when clicked.
.IP "click_raise [boolean]"
If set to "true" windows will be risen when they (meaning the window itself, not its frame) are clicked, if set to "false" this behavior is disabled.
.IP "focus_new [boolean]"
If set to "true" new windows will be focussed when they appear and accordingly a value of "false" disables this behaviour. If you are dragging a window or in window list mode at the time of the window apearing the new window shall not be focussed even with this option set to "true".
.IP "center_title [boolean]"
If set to "true" the title of windows will apear in the center of the titlebar, if set to "false" it will be at the left.
.IP "center_wlist_items [boolean]"
If set to "true" all titles in the window list are centered, if set to "false" they are aligned at the left.
.IP "map_center [boolean]"
If set to "true" new windows will appear centered (unless they have a predefined position set). If set to "false" the windows will not be moved before mapping.
.IP "drag_warp [boolean]"
If set to "true" moving a window over the right edge of the desktop will move it to the left of the next virtual desktop and vice versa.
.IP "buttons_left [button] [...]"
Set a list of buttons (from left to right) to show at the left of the title of windows. Possible buttons are "iconify", "expand", "maximize", "close", "sticky", "ontop" and "below", they do the same as the actions with the same names described below. Can be set to "none" if you want no buttons there. Buttons can be clicked with either the first (left) or the third (right) mouse button.
.IP "buttons_right [button] [...]"
Same as the "buttons_left" option but for buttons at the right of the titlebar.
.IP "taskbar_ontop"
If set to "true" taskbar windows that use EWMH hints will be kept ontop, if set to "false" windows can cover them.
.IP "ewmh_screen [integer]"
Set the screen (in xinerama setups) to wich desktop windows etc go to [integer] (screens are in the order X11 places them).
.IP "fullscreen_stacking [stacking mode]"
If set to "normal" fullscreen windows behave like other windows in terms of stacking, when this is set to "ontop" they can raise over always-on-top windows and if set to "always_ontop" fullscreened windows are always on top and new windows will not be focussed if theres a fullscreen window above them. 
.IP "allow_focus_stealing [boolean]"
If set to "false" matwm will confine input focus to the window you manually focussed (with exeption windows that use EWMH to focus windows, and newly mapped windows if focus_new is set to "true").
.IP "correct_center [boolean]"
If this is set to "true" windows wich are placed in the center of the root window, are placed in the center of the current screen (for xinerama setups). This behaviour is omitted if the window is bigger then the current screen.
.IP "correct_center_unmanaged [boolean]"
Same as above but for windows that set override_redirect.
.IP "correct_center_separate [boolean]"
If set to "true" above two settings apply for x and y axis individually, else they only work for windows that are centered on both x and y axis.
.IP "click_root [boolean]"
If this is set to "false" matwm will not choose to receive ButtonPress events from the root window, thus allowing other applications to do so (this breaks root_button[1-5] and root_double[1-5] options).
.IP "button[1-5] [action]"
Sets the function mouse buttons have on window borders. Possible button actions are "move", "resize", and any of the actions listed below. "move" and "resize" raise the window and let the user drag it to resize or move it while the mouse button is held down.
.IP "double[1-5] [action]"
Same as the above, but for double clicks.
.IP "root_button[1-5] [action]"
To set what a click on the root window does.
.IP "root_double[1-5] [action]"
And for double clicks on the root window.
.IP "resetkeys"
Remove all previously defined key bindings from memory.
.IP "key [modifier key] [...] [X11 key name] [action]"
Binds the specified modifier and key combination to [action]. Key names are obtained from <X11/keysymdef.h> by removing the XK_ prefix from each name.
.PP
Following is a list of possible actions and their explanation.
.IP "exec [command]"
Invokes "sh -c [command]".
.IP "next"
Focus the next window in the stacking. Pressing a key bound to this or the "prev" action will show you a list with all currently visible and iconic windows, wich will dissapear when all modifiers of either key action are released. Afterwards the window selected will be raised. If it is off screen it will be brought back on screen, also the mouse will be warped to the bottom right corner of the window. Between the last normal window and the first iconic window there will be slightly more spacing, to clarify what windows are iconic. Items in this list can also be focussed with the mouse in the same way as windows. This and the following option can only be bound to key combinations with at least one modifier key.
.IP "prev"
Focus the previous window in the stacking.
.IP "iconify"
Iconify the current window (window will dissapear, but can be found in either a taskbar that complies with the EWMH specification, or the window list that apears if one of the two functions above is called). Iconified windows will be placed at the very bottom of the stack (so for icons top to bottom order in the window list complies with first to last window iconified).
.IP "maximise [direction] [...]"
Maximise the current window, or revert a maximised window to its previous state. The optional argument [direction] can be h, v, l, r, d or u (respectively horizontal, vertical, left, right, up and down), or a combination of those to specify the action is to be comitted only in the specified direction(s).
.IP "expand [direction] [...]"
This function serves to grow a window in size as much as is possible without overlapping any more windows then are currently already overlapped by it. The [direction] argument does exactly what is does for the maximise key action. By default it calculates available horizontal space first, to make it calculate vertical space first you can add and a to the direction argument.
.IP "fullscreen"
Make the current window apear fullscreen, or revert a fullscreen window to its previous state.
.IP "close"
Send a WM_DELETE_WINDOW the current window if the window supports it, else destroy it with XKillClient().
.IP "sticky"
Make the current window sticky (appear on all desktops), or reverses this.
.IP "ontop"
Toggle always-on-top mode for the current window.
.IP "below"
Toggle stay-below mode for the current window.
.IP "title"
Toggle display of title bar for the current window.
.IP "iconify_all"
Iconify all windows. If no iconic windows are restored after the last call to this function, the next call to it will restore the windows iconified with it. If your taskbar uses EWMH and has a "show desktop" button, it can also be used to do this.
.IP "next_desktop"
Go to the next virtual desktop.
.IP "prev_desktop"
Go to the previous virtual desktop.
.IP "to_border [border] [...]"
Move the current window to a border or corner of the screen, argument is one or more of l, r, t and b (left, right, top and bottom respectively).
.IP "raise"
Raise the current window to the top of the stack.
.IP "lower"
Lower the current window to the bottom of the stack.
.IP "quit"
Exit
.B matwm2
.
.SH AUTHORS
Mattis Michel <sic_zer0@hotmail.com>
.PP
Many thanks to Kirn Gill and Matthew Turner for bug reports, suggestions and patches.
.SH SEE ALSO
.BR XQueryColor(3),
.BR XStringToKeysym(3),
.BR xmodmap(1)
